Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@sp-api-sdk/auth
Advanced tools
@sp-api-sdk/auth
Package for simplifying authentication with Selling Partner API
yarn add @sp-api-sdk/auth
npm install @sp-api-sdk/auth
With Security Token Service :
import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
const auth = new SellingPartnerApiAuth({
clientId: '',
clientSecret: '',
refreshToken: 'Atzr|...',
accessKeyId: '',
secretAccessKey,
role: {
arn: roleArn,
sessionName: 'SellingPartnerAPI'
},
})
const accessToken = await auth.accessToken.get()
const { AccessKeyId, SecretAccessKey, SessionToken } = await auth.getCredentials()
With scopes (for grantless APIs):
import {SellingPartnerApiAuth, AuthorizationScope} from '@sp-api-sdk/auth'
import {AuthorizationApiClient} from '@sp-api-sdk/authorization-api-v1'
const auth = new SellingPartnerApiAuth({
clientId: '',
clientSecret: '',
scopes: Object.values(AuthorizationScope), // Or choose the only ones you need
secretAccessKey: '',
accessKeyId: '',
region: '',
role: {
arn: '',
}
})
const client = new AuthorizationApiClient({
auth,
region: 'eu' // or 'eu-west-1'
})
With an AWS user :
import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
const auth = new SellingPartnerApiAuth({
clientId: '',
clientSecret: '',
refreshToken: 'Atzr|...',
accessKeyId: '',
secretAccessKey,
user: {
AccessKeyId: '',
SecretAccessKey: ''
}
})
const accessToken = await auth.accessToken.get()
const { AccessKeyId, SecretAccessKey } = await auth.getCredentials()
Everytime you get the access token, the class will check before if the token has already been fetch or if it's still valid, if not, it will fetch it.
Same for the given credentials from Security Token Service
FAQs
Amazon Selling Partner API authentication package
The npm package @sp-api-sdk/auth receives a total of 474 weekly downloads. As such, @sp-api-sdk/auth popularity was classified as not popular.
We found that @sp-api-sdk/auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.